package com.admin.service;

import com.admin.common.context.DeclareContext;
import com.admin.domain.*;
import com.admin.req.declare.*;
import com.admin.vo.PageVO;
import com.admin.vo.ResultVO;
import com.admin.vo.declare.DeclareListVO;
import com.admin.vo.declareDetail.DeclareDetailVO;

import java.util.Map;

/**
 * 申报service
 *
 * @author yangzhongliang
 * @date 2022/05/16
 */
public interface DeclareService {

    /**
     * 是否已经提交过申报记录
     * @param userId
     * @return
     */
    boolean isSubmitDeclare(Integer userId);

    /**
     * 获取用户当前的申报记录
     * @param userId
     * @param startTime
     * @return
     */
    Declare getCurrentDeclare(Integer userId, Integer startTime);


    /**
     * 列表
     * @param pageIndex
     * @param pageSize
     * @param params
     * @return
     */
    ResultVO<PageVO<DeclareListVO>> getPageList(Integer pageIndex, Integer pageSize, Map<String, Object> params);

    /**
     * 保存申报信息
     * @param userId
     * @param declareReq
     * @return
     */
    ResultVO save(Integer userId, DeclareReq declareReq);

    /**
     * 正常申报
     * @param declareContext
     * @return
     */
    Declare saveNormalDeclareInfo(DeclareContext declareContext);

    /**
     * 提标申报
     * @param declareContext
     * @return
     */
    Declare saveUpgradeDeclareInfo(DeclareContext declareContext);


    /**
     * 修改申报信息
     * @param userId
     * @param declareReq
     * @return
     */
    Declare update(Integer userId, DeclareReq declareReq);


    /**
     * 保存 - 修改 -基础信息
     * @param declareId
     * @param basicReq
     */
    void saveDeclareBasic(Integer declareId, DeclareBasicReq basicReq);


    /**
     * 保存-修改-制度机制
     * @param declareId
     * @param institutionReq
     */
    void saveDeclareInstitution(Integer declareId, DeclareInstitutionReq institutionReq);

    /**
     * 保持 - 修改 - 防灾准备
     * @param declareId
     * @param disasterPlanReq
     */
    void saveDeclareDisasterPlan(Integer declareId, DeclareDisasterPlanReq disasterPlanReq);

    /**
     * 保存 - 修改 - 避灾设施
     * @param declareId
     * @param facilitiesReq
     */
    void saveDeclareDisasterFacilities(Integer declareId, DeclareDisasterFacilitiesReq facilitiesReq);

    /**
     * 保存 - 修改 - 科普培训
     * @param declareId
     * @param declareScienceReq
     */
    void saveDeclareScience(Integer declareId, DeclareScienceReq declareScienceReq);

    /**
     * 保存- 修改 - 典型案例
     * @param declareId
     * @param classicCaseReq
     */
    void saveDeclareClassicCase(Integer declareId, DeclareClassicCaseReq classicCaseReq);

    /**
     * 保存 - 修改 - 区县气象局
     * @param declareId
     * @param weatherBureauReq
     */
    void saveDeclareWeatherBureau(Integer declareId, DeclareWeatherBureauReq weatherBureauReq);

    /**
     * 保存 - 修改 - 提标升级
     * @param declareId
     * @param upgradeReq
     */
    void saveDeclareUpgrade(Integer declareId, DeclareUpgradeReq upgradeReq);


    /**
     * 删除，逻辑删除
     * @param declareId
     */
    boolean delete(Integer declareId);


    /**
     * 提交上级
     * @param id
     * @return
     */
    Boolean submitArea(Integer id);


    /**
     * 详情 - 预览 - 接口
     * @param id
     * @param source
     * @return
     */
    DeclareDetailVO detail(Integer id, String source);


    /**
     * 模块名称
     * @param moduleName
     * @return
     */
    String getScoreRule(String moduleName);

}
